<?php
/*
 * 教师表格的自动验证和自动填充
 * 作者:Tobey
 * */
class teacherModel{
    /*
     * 自动验证
     * */
    public $validate = array(
        /*
         *注册的时候进行验证  1
         * */
        array("tea_email","email","邮箱格式有误!","regex",1,1),
        array("tea_number","require","教师工号不能为空!","regex",1,1),
        array("tea_number",array(4,20),"教师工号4-20为!","length",1,1),
        array("tea_password_hash","require","密码不能为空!","regex",1,1),     
        array("tea_password_hash",array(6,32),"密码最少6位!","length",1,1),     
        array("tea_name","require","姓名不能为空!","regex",1,1),
        /*
         *更新基本信息的时候进行验证  5
         * */
        array("tea_name","require","教师姓名不能为空!","regex",1,5),        
        array("sex",array("男","女"),"性别有误!","in",1,5),         
    );

    /*
     * 自动填充
     * */
    public $auto = array(
        /*
         * 1表示新增的时候进行自动填充
         * */
        array("sex","fill","男",1),            //性别自动男
    );

}